;
; vdBox.asm
;
; vdBox(ur,uc,lr,lc,attr)
;
;
;--------------------------------------
;
; include defs, prototypes and macros
;

include tab6.inc

;--------------------------------------
;
; begin code segment
;

	.CODE

vdBox PROC PASCAL PUBLIC USES ES DS DI SI BX,ur:BYTE,uc:BYTE,lr:BYTE,lc:BYTE,a:BYTE,s:BYTE
        LOCAL   rep_len:BYTE  ; holds lengh of repeat funs
        LOCAL   h_char:BYTE   ; holds horizontal character
        LOCAL   v_char:BYTE   ; holds vertical char
        LOCAL   ulc:BYTE      ; holds upper left corner character
        LOCAL   urc:BYTE      ; holds upper right corner character
        LOCAL   llc:BYTE      ; holds lower left corner character
        LOCAL   lrc:BYTE      ; holds lower right corner character

        .IF (s == S_S_S_S)
        mov     h_char,196
        mov     v_char,179
        mov     ulc,218
        mov     urc,191
        mov     llc,192
        mov     lrc,217
        .ELSEIF (s == D_D_D_D)
        mov     h_char,205
        mov     v_char,186
        mov     ulc,201
        mov     urc,187
        mov     llc,200
        mov     lrc,188
        .ELSE 
        mov     h_char,205
        mov     v_char,179
        mov     ulc,213
        mov     urc,184
        mov     llc,212
        mov     lrc,190
        .ENDIF
                

        mov     al,lc
        sub     al,uc
        mov     rep_len,al
        INVOKE  vdHRep,ur,uc,rep_len,h_char,a
        INVOKE  vdHRep,lr,uc,rep_len,h_char,a

        mov     al,lr
        sub     al,ur
        mov     rep_len,al
        INVOKE  vdVRep,ur,uc,rep_len,v_char,a
        INVOKE  vdVRep,ur,lc,rep_len,v_char,a

        INVOKE  vdChar,ur,uc,ulc,a
        INVOKE  vdChar,lr,uc,llc,a
        INVOKE  vdChar,ur,lc,urc,a
        INVOKE  vdChar,lr,lc,lrc,a
	ret
vdBox	ENDP
	END
	
	

